const { Schema, SchemaTypes } = require('../schema');
class CreditAmount extends Schema {
    PropertyModelDataTemplate () {
        return {
            userId: { type: SchemaTypes.ObjectId, required: true },
            areaId: { type: SchemaTypes.ObjectId, required: true },
            isEnable: { type: SchemaTypes.Boolean, required: true, default: false },

            // 信用金总额(单位：元)
            creditAmount: { type: SchemaTypes.Number, required: true },
            // 已使用金额(单位：元)
            useCreditAmount: { type: SchemaTypes.Number, required: false },

            createTime: { type: SchemaTypes.Number, required: true, default: require('../../module/tool/time').getCurrentTimestamp() }

        };
    }
}

module.exports = CreditAmount;
